﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace UDPHelper
{
    public static class StreamEx
    {
        public static void WriteFullBytes(this Stream _stream, byte[] data)
        {
            _stream.Write(data, 0, data.Length);
        }

        public static void WriteFullBytesLine(this Stream _stream, byte[] data = null)
        {
            if (data != null)
                _stream.WriteFullBytes(data);

            _stream.WriteFullBytes(Encoding.ASCII.GetBytes("\r\n"));
        }
    }
}
